package com.ilink.teacherservice.mapper.Screen;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;
import java.util.List;
@Mapper
public interface SchoolDistributionMapper {


    @Select({
            "SELECT school_name, COUNT(*) AS total_user_count, COUNT(DISTINCT userMajor) AS major_count",
            "FROM tb_user",
            "WHERE school_name IS NOT NULL AND userMajor IS NOT NULL",
            "GROUP BY school_name"
    })
    List<Map<String, Object>> findSchoolDistribution();

}
